import request from '@/utils/request'
import type { ApiRes } from '@/types/data'
import type { SwiperQuery, SwiperList, SwiperData } from '@/types/swiper'

// 获取轮播图信息列表
export const getSwiper = (params: SwiperQuery) => {
  return request<ApiRes<SwiperList>>({
    url: 'banner/list',
    params
  })
}

// 新增轮播图
export const getAddSwiperData = (data: SwiperData) => {
  return request({
    url: 'banner/add',
    method: 'POST',
    data
  })
}

// 修改轮播图
export const updateSwiper = (data: SwiperData) => {
  return request({
    url: 'banner/update',
    method: 'POST',
    data
  })
}
// 修改轮播图
export const deleteSwiper = (data: string) => {
  return request({
    url: `banner/delete/${data}`,
    method: 'DELETE'
  })
}
